<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue</title>
    <script src="../vue.js"></script>
    <style>
        .pink{
            background: pink;
        }
        .bold{
            font-weight: bold;
        }
        .public{
            width: 100px;
            height: 200px;
        }
        .active{
            background-color:coral;
        }
        .italic{
            font-style: italic;
        }
    </style>
</head>

<body>
    <div id="app">
        <p class="public" :class="isActive?'active':'' ">box1</p>
        <p class="public" :class="{pink:isPink,bold:isBold,italic:isItalic}">box2</p>
        <p class="public" :class="classArr">box3</p>
        <!-- <p class="public" :class="">box4</p> -->

    </div>
    <script>
        Vue.config.productionTip = false;
        
        const vm = new Vue({
            el: "#app",
            data() {
                return {
                    isActive:true,
                    box2Class:{
                        pink:true,
                        bold:true,
                        italic:true
                    },
                    isPink:true,
                    isBold:true,
                    isItalic:true,
                    classArr:['pink','bold']
                }
            }
        })
    </script>
</body>

</html>